#
#  OSPFv2 hello test suite Makefile
#

#----------------------------------------------------------- SETUP

VERSION = 0.2.1
TOPDIR = ../../../../../../..
include $(TOPDIR)/Makefile.common

JAVAC = javac -classpath $(SSFNET_TEST_CLASSPATH)
JAVA  = java  -classpath $(SSFNET_TEST_CLASSPATH)

# This is for the cygwin environment which has trouble with the mix of
# slashes and backslashes... Take care, that the classpath is set correctly!
ifeq ($(OSTYPE), cygwin)
JAVAC = javac
JAVA  = java
endif

SHARED=../shared
VERDICT=$(SHARED)/verdict.pl
REPORT=report.log
COMPLETE=complete.log

#TESTS=01_addr 02_virtual 03_waiting_state \
#04_backupseen 05_no_waiting 06_accept_dr 07_dr_collision \
#08_bdr_dr 09_dr_other_bdr 10_mismatch 11_remote \
#12_e_bit

TESTS=01_addr 10_mismatch 11_remote \
12_e_bit
#----------------------------------------------------------- MAKE tests
tests:
	@list='$(TESTS)'; for testcase in $$list; do \
	(cd $$testcase && $(MAKE))\
	done;
	@$(VERDICT) hello.ospf.v4.ip $(REPORT) $(TESTS) > $(REPORT)
	@cat $(REPORT)

#----------------------------------------------------------- MAKE report
report:
	@echo "######## Complete Test Report for hello.ospf.v4.ip ########" > $(COMPLETE)
	@list='$(TESTS)'; for testcase in $$list; do \
	(cat $$testcase/report.log >> $(COMPLETE))\
	done;
	@cat $(REPORT) >> $(COMPLETE)

#----------------------------------------------------------- MAKE clean
clean:
	rm -f *.log *.tcpdump *.dump *.bak *~
	@list='$(TESTS)'; for testcase in $$list; do \
	(cd $$testcase && $(MAKE) clean)\
	done;
